package day1026.TuXing;
//三角形
public class Triangle extends Image {
    private int a,b,c;

    public Triangle(int a, int b, int c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    @Override
    public double mianji() {
        double result =0.0;
        result =Math.sqrt((a+b+c)/2*((a+b+c)/2-a)*((a+b+c)/2-b)*((a+b+c)/2-c));
        System.out.println("三角形面积是:"+result);
        return result;
    }

    @Override
    public double zhouchang() {
        double result=0.0;
        result =a+b+c;
        System.out.println("三角形周长是:"+result);
        return result;
    }
}
